package com.hyts.distlock.lock;

/**
 * project-name:coffice-toolbox
 * package-name:com.hyts.distlock.lock
 * author:Libo/Alex
 * create-date:2019-05-10 22:22
 * copyright:libo-hyts-github
 * email:libo2dev@aliyun.com
 * description:此类主要用于: 主要用于操作相关定义对应的Redis服务操作锁对象
 */
//泛型
public abstract class RedisLock<T> extends BaseLock<T> {

    /**
     * Lock对象构造器
     *
     * @param lockObjectClient
     */
    public RedisLock(T lockObjectClient) {
        super(lockObjectClient);
    }

    /**
     * @param requireTime 加锁请求时间
     * @param lockExpireTimeout 锁超时失效时间
     * @return 返回对于的key值-为 系统默认的前缀
     */
    public abstract String tryLock(Long requireTime,Long lockExpireTimeout);

    public abstract String tryLock(Long requireTime,Long lockExpireTimeout,String lockValue);

    public abstract String tryLock(String key,Long requireTime,Long lockExpireTimeout);

    public abstract String tryLock(String key,String lockValue,Long requireTime,Long lockExpireTimeout);

    public abstract String unLock(String key,String lockValue);

    public abstract String unLock(String key);


}
